#ifndef HMICOMMONDEFINE_H
#define HMICOMMONDEFINE_H

//#define D_ROBOT_AXIS_MAX 16 重复定义 instructionEnum.h

#define JOG_TIME 100            //关节运动定时器

#define TRYLOCKTIME 1000        //数据 定时更新锁
#define TRYLOCKTIME_QUICK 500

//#define GSOAP_UPDATE_400 400    //数据 定时更新锁 至界面用
//#define GSOAP_UPDATE 150         //数据 定时更新锁 至界面用300
#define TOP_UPDATE 160
#define VIEW_UPDATE 140          //界面用

#define SHUT_DOWN_TIME 30       //关机时间

#define D_HMI_CHINESE_PYDB_PATH "/agvwork/AgvHmi/baseBag/hmiProject/resources/ChinesePY.db"
#define D_HMI_PENDENT_UDISK_PATH "/mnt/udisk/"
#define D_HMI_PENDENT_UDISK2_PATH "/run/media/sda1/"
#define D_HMI_PENDENT_UDISK3_PATH "/run/media/sdb1/"

#define D_COMPANY_INFO_IMAGE_PATH "/agvwork/AgvFundation/fundation/picture/CompanyInformation.png"
#define D_USUAL_BUTTON_FUNCTION_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/menuCfg.xml"

/*显示风格文件*/
#ifdef BUILD_X86_WINDOWS
#define D_SHOW_STYLE_PATH "../../data/showStyle.ini"
#else
#define D_SHOW_STYLE_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/showStyle.ini"
#endif

#ifdef BUILD_X86_WINDOWS
#define D_SAFEINFO_PATH "../../data/safetyNotice"
#else
#define D_SAFEINFO_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/safetyNotice"
#endif

/*模块配置文件*/
#ifdef BUILD_X86_WINDOWS
#define D_MODULE_CONFIG_PATH "../../data/moduleConfig.ini"
#else
#define D_MODULE_CONFIG_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/moduleConfig.ini"
#endif

/*登录IP(hmi与控制器)保存文件*/ //#define CTRL_IP_INI_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/ctrlIP.ini"
#ifdef BUILD_X86_WINDOWS
#define CTRL_IP_INI_PATH "../../data/ctrlIP.ini"
#else
#define CTRL_IP_INI_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/ctrlIP.ini"
#endif

/*版本信息 ini文件*/
#ifdef BUILD_X86_WINDOWS
#define VERSION_INI_PATH "../../data/version.ini"
#else
#define VERSION_INI_PATH "/agvwork/AgvHmi/baseBag/hmiProject/data/version.ini"
#endif

/*程序文件地址(默认,登陆后根据机器人变化,不再使用)*/

#ifdef BUILD_X86_WINDOWS
#define PROGRAM_PATH "x:\\robotData1\\program "
#else
#define PROGRAM_PATH "/agvwork/AgvFundation/fundation/data/robotData1/program/"
#endif

/*地图文件地址(默认,登陆后根据机器人变化,不再使用)*/

#ifdef BUILD_X86_WINDOWS
#define PROGRAM_PATH "x:\\robotData1\\map "
#else
#define D_MAP_PATH "/agvwork/AgvFundation/fundation/data/robotData1/map/"
#endif

/*备份还原 USB地址*/ //后面改到底层去做

#ifdef BUILD_X86_WINDOWS
#define CONTROLLER_USB_DISK_ADDRESS "c:\\linuxControllerDataBackup_usb"
#else
#define CONTROLLER_USB_DISK_ADDRESS "/root/uscd"
#endif
/*备份还原 磁盘地址*/ //后面改到底层去做

#ifdef BUILD_X86_WINDOWS
#define CONTROLLER_HARD_DISK_ADDRESS "c:\\linuxControllerDataBackup"
#else
#define CONTROLLER_HARD_DISK_ADDRESS "/agvwork/AgvFundation/fundation/data/backupData"
#endif

// 机器人图片文件
#ifdef BUILD_X86_WINDOWS
#define D_ROBOT_IMAGE_PATH
#else
#define D_ROBOT_IMAGE_PATH "/agvwork/AgvFundation/fundation/data/robotImage/"
#endif

// 控制器配置文件
#ifdef BUILD_X86_WINDOWS
#define PROGRAM_PATH "x:\\robotData1\\config "
#else
#define D_CONFIG_PATH "/agvwork/AgvFundation/fundation/data/robotData1/config/"
#endif

// 控制器消息日志文件
#ifdef BUILD_X86_WINDOWS
#define PROGRAM_PATH "x:\\robotData1\\logFile "
#else
#define D_LOGFILE_PATH "/agvwork/AgvFundation/fundation/data/globalConfig/logFile/"
#endif

// 样式文件
#ifdef BUILD_X86_WINDOWS
#define PROGRAM_PATH "x:\\robotData1\\logFile "
#else
#define D_QSS_PATH "/agvwork/AgvHmi/baseBag/hmiProject/resources/style/style.qss"
#endif

//hmi
/**
 * @brief The EM_MID_VIEW_ID enum           主窗口ID
 */
enum EM_MID_VIEW_ID{
    MID_VIEW_RUN,                   //运程
    MID_VIEW_JOG,                   //寸动
    MID_VIEW_PROGRAM,               //程序
    MID_VIEW_IO,                    //io
    MID_VIEW_MESSAGE,               //消息

    MID_HOME_MENU,                  //主菜单
    MID_VIEW_PROGRAM_FILE,          //程序文件打开
    MID_VIEW_REGISTER,              //注册
    MID_VIEW_CRAFT_TOOL,
    MID_VIEW_END
};

/**
 * @brief The EM_MESSAGE_LEVEL enum　消息级别
 */
enum EM_MESSAGE_LEVEL
{
    EM_MESSAGE_LEVEL_ERROR = 0,
    EM_MESSAGE_LEVEL_WARN = 1,
    EM_MESSAGE_LEVEL_NOTE = 2,
    EM_MESSAGE_LEVEL_WAIT = 3,

    EM_MESSAGE_LEVEL_END = 4
};

/**
 * @brief The EM_AXIS_NUM enum              对应轴
 */
enum EM_AXIS_NUM{
    EM_AXIS_1,
    EM_AXIS_2,
    EM_AXIS_3,
    EM_AXIS_4,
    EM_AXIS_5,
    EM_AXIS_6,
    EM_AXIS_7,
    EM_AXIS_END
};

///**
// * @brief The EM_AXIS_UNIT enum             轴单位
// */
//enum EM_AXIS_UNIT{
//    EM_AXIS_DEG,
//    EM_AXIS_MM
//};

/**
 * @brief The EM_DIRECTION enum             左右/负正
 */
enum EM_DIRECTION{
    EM_DIRECTION_LEFT,
    EM_DIRECTION_RIGHT,
    EM_DIRECTION_END
};

/**
 * @brief The EM_MESSAGE_SHOW_TYPE enum     消息框的类型
 */
enum EM_MESSAGE_SHOW_TYPE
{
    EM_MSG_BOX_ALL_BTN,
    EM_MSG_BOX_SURE_BTN,
    EM_MSG_BOX_NO_BTN
};

//enum ENUM_CTRL_FLAG             //控制状态:off on fail三态,适用各个标志位场合
//{
//    EM_CF_OFF,
//    EM_CF_ON,
//    EM_CF_FAIL,
//    EM_CF_END
//};

enum ENUM_GSOAP_CONNECT         //连接专用状态:连接错误,连接成功
{
    EM_CONNECT_ERROR,
    EM_CONNECT_SUCCESS,
    EM_CONNECT_END
};

enum ENUM_REG_STATUS            //注册状态专用:有效,即将过期,过期,永久有效,不正确(舍弃)
{
    EM_REG_OK,
    EM_REG_GOING,
    EM_REG_OVERTIME,
    EM_REG_FOREVER,
    EM_REG_ERROR
};

enum POLLCODE_STATUS_TYPE       //新 注册状态
{
    ENUM_TIME_NORMAL = 100,
    ENUM_TIME_GOING_PASSED,
    ENUM_TIME_PASSED,
    ENUM_SERIAL_UNEQUAL,
    ENUM_REGISTER_NO_EXIST,
    ENUM_REGISTER_FILE_NODE_ERROR,
    ENUM_REGISTER_FILE_CHECK_CODE_ERROR,
    ENUM_BOOT_COUNT_EXCEED,
    ENUM_POLLCODE_END
};



//enum LANGUAGE_TYPE              //语言类型
//{
//    ENUM_LAN_CHINESE,           //中文
//    ENUM_LAN_ENGLISH,           //英文
//    ENUM_LAN_END
//};

enum ENUM_DEV_STATUS_FLAG       //dev 控制状态:off on
{
    EM_DEV_STATUS_OFF,
    EM_DEV_STATUS_ON
};

enum ENUM_TIME_MODE
{
    EM_TIME_STOP,
    EM_TIME_START,
    EM_TIME_RESET
};

//from jogview 华磊
enum EM_CONTROL_MODE{
    EM_CONTROL_MODE_T1=0,
    EM_CONTROL_MODE_T2=1,
    EM_CONTROL_MODE_AUTO=2,
    EM_CONTROL_MODE_EXT=3,
    EM_CONTROL_MODE_FLEET=4
};

enum EM_JOG_COORDINATE{
    EM_JOG_COORDINATE_JOINT=0,
    EM_JOG_COORDINATE_TOOL=1,
    EM_JOG_COORDINATE_USER=2,
    EM_JOG_COORDINATE_WORLD=3
};

enum EM_DEBUG_MODE{
    EM_DEBUG_MODE_STEP=0,
    EM_DEBUG_MODE_CONTINUE=1
};

enum EM_ACCOUNT{
    EM_ACCOUNT_USER=0,
    EM_ACCOUNT_ADMIN=1
};

enum EM_INTERPRETATION_STATUS{
    EM_INTERPRATATION_STATUS_STOP=0,
    EM_INTERPRATATION_STATUS_RUN=1,
    EM_INTERPRATATION_STATUS_ERROR=2
};

//伺服状态
enum EM_MOTOR_STATUS{
    EM_MOTOR_STATUS_SERVO_OFF=0,
    EM_MOTOR_STATUS_SERVO_ON=1,
    EM_MOTOR_STATUS_SERVO_ERROR=2
};

//from serverCtrl:点位保存
//enum STOP_COMMAND_TYPE
//{
//    ENUM_COMMAND_RESET,//停止
//    ENUM_COMMAND_RUN,//运行嗯
//    ENUM_COMMAND_CEASE,//中断
//    ENUM_COMMAND_END//err
//};

//from serverCtrl:点位保存
//enum SAVE_POS_TYPE
//{
//    EM_CF_DEG_TYPE,
//    EM_CF_WORLD_TYPE,
//    EM_CF_ELSE_END
//};

//enum WORLD_POS_TYPE
//{
//    EM_CF_X,
//    EM_CF_Y,
//    EM_CF_Z,
//    EM_CF_W,
//    EM_CF_P,
//    EM_CF_R,
//    EM_CF_WORLD_POS_END
//};

//enum STACK_UP_DOWN_TYPE
//{
//    EM_STACK_PALLET,
//    EM_STACK_DEPALLET,
//    EM_STACK_PALLET_END
//};

//enum STACK_AUX_TYPE
//{
//    EM_STACK_AUX_NONE,
//    EM_STACK_AUX_EXIST,
//    EM_STACK_AUX_END
//};

//enum STACK_ORDER_TYPE
//{
//    EM_ORDER_RCL,
//    EM_ORDER_CRL,
//    EM_STACK_ORDER_END
//};

/**
 * @brief The PAL_TYPE enum     码垛指令
 */
//enum PAL_TYPE{PAL_B,PAL_BX,PAL_E,PAL_EX,PAL_END};

////检查指令正确性用
//enum INSTRUCTION_TYPE
//{
//    MOTION,WAIT,GOTO,JUMP,REG,IO,
//    LABEL,RUN,RUN1,SELECT,IF,CALL,
//    FOR,ENDFOR,PAL,COORDINATE,
//    ANOTATION,PROCESS,OTHERTYPE,
//    MOVE_MAG,MOVE_FREE,
//    MODBUS_START,MODBUS_READ,MODBUS_WRITE,
//    SET_ODOM,
//    TCP_START,TCP_READ,TCP_WRITE,
//    MUSIC,
//    CHARGING,
//    LIFT,
//    LOAD_MAP,
//    CHECK_BATTERY,
//    WAIT_COMMAND,
//    ROBOT_MOVE,
//    ROLLER,
//    ERR
//};

//坐标系问题
enum SET_TOOL
{
    ENUM_TOOL_3POINTS = 0,
    ENUM_TOOL_6POINTS = 1,
    ENUM_TOOL_XYZWPR = 2,
    ENUM_TOOL_20POINTS = 3,
    ENUM_TOOL_23POINTS = 4,
    ENUM_TOOL_20POINTS_ZEROCAL = 5,
};

enum SET_USER
{
    ENUM_USER_3POINTS = 0,
    ENUM_USER_4POINTS = 1,
    ENUM_USER_XYZWPR = 2
};

//from iomap
enum IO_VALUE_TYPE{
    IO_TYPE_NULL,
    IO_TYPE_DI,
    IO_TYPE_DO,
    IO_TYPE_AI,
    IO_TYPE_AO,
    IO_TYPE_SI,
    IO_TYPE_SO
};

enum MOVE_POINT_TYPE{
    POINT_NORMAL,
    POINT_PALLET,
    POINT_PR
};




enum FTP_OPERATE_TYPE
{
    EM_FTP_OPERATE_LOGIN = 0,           // 下载登录文件
    EM_FTP_OPERATE_MUSIC = 1,           // 下载音乐文件
    EM_FTP_OPERATE_LOAD_MAP = 2,        // 下载地图文件
    EM_FTP_OPERATE_FILE_MANAGE = 3,     // 文件管理模块下载文件
    EM_FTP_OPERATE_CREATE_FILE = 4,     // 创建文件
    EM_FTP_OPERATE_SAVE_FILE = 5,       // 保存文件时上传文件

    EM_FTP_OPERATE_CLOSE = -1,          // 关闭ftp操作
};




#endif // HMICOMMONDEFINE_H
